Optimal. Leaf size=148 \[ \frac{4 i a^2 (a+i a \tan (e+f x))^{1-n} (d \sec (e+f x))^{2 n}}{f \left (n^2+3 n+2\right )}+\frac{8 i a^3 (a+i a \tan (e+f x))^{-n} (d \sec (e+f x))^{2 n}}{f n \left (n^2+3 n+2\right )}+\frac{i a (a+i a \tan (e+f x))^{2-n} (d \sec (e+f x))^{2 n}}{f (n+2)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.211018, antiderivative size = 148, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 32, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.062, Rules used = {3494, 3493} \[ \frac{4 i a^2 (a+i a \tan (e+f x))^{1-n} (d \sec (e+f x))^{2 n}}{f \left (n^2+3 n+2\right )}+\frac{8 i a^3 (a+i a \tan (e+f x))^{-n} (d \sec (e+f x))^{2 n}}{f n \left (n^2+3 n+2\right )}+\frac{i a (a+i a \tan (e+f x))^{2-n} (d \sec (e+f x))^{2 n}}{f (n+2)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3494
Rule 3493
Rubi steps
\begin{align*} \int (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{3-n} \, dx &=\frac{i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{2-n}}{f (2+n)}+\frac{(4 a) \int (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{2-n} \, dx}{2+n}\\ &=\frac{4 i a^2 (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n}}{f \left (2+3 n+n^2\right )}+\frac{i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{2-n}}{f (2+n)}+\frac{\left (8 a^2\right ) \int (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n} \, dx}{2+3 n+n^2}\\ &=\frac{4 i a^2 (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{1-n}}{f \left (2+3 n+n^2\right )}+\frac{i a (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{2-n}}{f (2+n)}+\frac{8 i a^3 (d \sec (e+f x))^{2 n} (a+i a \tan (e+f x))^{-n}}{f n \left (2+3 n+n^2\right )}\\ \end{align*}
Mathematica [A] time = 1.84091, size = 129, normalized size = 0.87 \[ \frac{i a^3 \sec ^2(e+f x) (\cos (3 f x)+i \sin (3 f x)) (a+i a \tan (e+f x))^{-n} (d \sec (e+f x))^{2 n} \left (\left (n^2+3 n+4\right ) \cos (2 (e+f x))+i n (n+3) \sin (2 (e+f x))+2 (n+2)\right )}{f n (n+1) (n+2) (\cos (f x)+i \sin (f x))^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.862, size = 0, normalized size = 0. \begin{align*} \int \left ( d\sec \left ( fx+e \right ) \right ) ^{2\,n} \left ( a+ia\tan \left ( fx+e \right ) \right ) ^{3-n}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 10.3702, size = 833, normalized size = 5.63 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.93509, size = 401, normalized size = 2.71 \begin{align*} \frac{{\left ({\left (i \, n^{2} + 3 i \, n + 2 i\right )} e^{\left (6 i \, f x + 6 i \, e\right )} +{\left (i \, n^{2} + 5 i \, n + 6 i\right )} e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (2 i \, n + 6 i\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 2 i\right )} \left (\frac{2 \, a e^{\left (2 i \, f x + 2 i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{-n + 3} \left (\frac{2 \, d e^{\left (i \, f x + i \, e\right )}}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{2 \, n} e^{\left (-6 i \, f x - 6 i \, e\right )}}{2 \,{\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (d \sec \left (f x + e\right )\right )^{2 \, n}{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{-n + 3}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]